using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
using DTO;

namespace DAO
{
   public  class LoaiDocGiaDAO
    {
       public List<LoaiDocGiaDTO> _laydsloaidocgia_DAO()
       {
           List<LoaiDocGiaDTO> list = new List<LoaiDocGiaDTO>();
           string sql = "select * from LoaiDocGia";
           DataTable dt = DataProvider.ExcuteQuery(sql);
           if (dt.Rows.Count > 0)
           {
               for (int i = 0; i < dt.Rows.Count; i++)
               {
                   DataRow dr = dt.Rows[i];

                   int maloaidocgia = int.Parse(dr["MaLoaiDocGia"].ToString());
                   string tenloaidocgia = dr["TenLoaiDocgia"].ToString();

                   LoaiDocGiaDTO ldg = new LoaiDocGiaDTO();
                   ldg.Maloaidocgia = maloaidocgia;
                   ldg.Tenloaidocgia = tenloaidocgia;
                   list.Add(ldg);
               }
           }
           return list;
       }
    }
}
